/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-02-03 09:01:55
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-18 11:36:47
 * @FilePath: \vue3_admin_template\project\src\api\user\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
//统一管理项目用户相关接口
import request from '@/utils/request'
//引入ts类型文件
import {
  LoginReqForm,
  LoginResponseData,
  UserInforesponseData,
} from './typeOld.ts'
//统一管理接口
enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
  // LOGIN_URL = "http://114.115.179.162:8022/prod-api/admin/acl/index/login",
  // USERINFO_URL = "http://114.115.179.162:8022/prod-api/admin/acl/index/info",
  LOGOUT_URL = '/user/logout',
}
//对外暴露请求函数
//登录接口相关方法
export const reqLogin = (data: LoginReqForm) =>
  // console.log("111111111111111111",data)
  request.post<any, LoginResponseData>(API.LOGIN_URL, data)
//获取用户信息接口相关方法
export const reqUserInfo = () =>
  request.get<any, UserInforesponseData>(API.USERINFO_URL)
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
